package com.hzvictory.hotel_system.service.Impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hzvictory.hotel_system.mapper.RoomorderMapper;
import com.hzvictory.hotel_system.pojo.entity.Roomorder;
import com.hzvictory.hotel_system.service.IRoomorderService;


/**
 * 功能
 * 作者：何征
 * 日期：2025/7/23 22:28
 */
@Service
public class RoomorderServiceImpl implements IRoomorderService
{
    @Autowired
    private RoomorderMapper roomorderMapper;

    /**
     * 查询房间订单
     *
     * @param id 房间订单主键
     * @return 房间订单
     */
    @Override
    public Roomorder selectRoomorderById(Long id)
    {
        return roomorderMapper.selectRoomorderById(id);
    }
    /**
     * 根据userId查询房间订单
     *
     * @param userId 房间订单主键
     * @return 房间订单
     */
    @Override
    public List<Roomorder> selectRoomorderListByUserId(Long userId)
    {
        return roomorderMapper.selectRoomorderByUserId(userId);
    }

    /**
     * 查询房间订单列表
     *
     * @param roomorder 房间订单
     * @return 房间订单
     */
    @Override
    public List<Roomorder> selectRoomorderList(Roomorder roomorder)
    {
        return roomorderMapper.selectRoomorderList(roomorder);
    }

    /**
     * 新增房间订单
     *
     * @param roomorder 房间订单
     * @return 结果
     */
    @Override
    public int insertRoomorder(Roomorder roomorder)
    {
        return roomorderMapper.insertRoomorder(roomorder);
    }

    /**
     * 修改房间订单
     *
     * @param roomorder 房间订单
     * @return 结果
     */
    @Override
    public int updateRoomorder(Roomorder roomorder)
    {
        return roomorderMapper.updateRoomorder(roomorder);
    }
    @Override
    public int updateRoomorderStatusById(Long id)
    {
        return roomorderMapper.updateRoomorderStatusById(id);
    }
    /**
     * 批量删除房间订单
     *
     * @param ids 需要删除的房间订单主键
     * @return 结果
     */
    @Override
    public int deleteRoomorderByIds(Long[] ids)
    {
        return roomorderMapper.deleteRoomorderByIds(ids);
    }

    /**
     * 删除房间订单信息
     *
     * @param id 房间订单主键
     * @return 结果
     */
    @Override
    public int deleteRoomorderById(Long id)
    {
        return roomorderMapper.deleteRoomorderById(id);
    }
}